/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Keith Augustsson
 */
@Entity
@Table(name = "consistsof")
@NamedQueries({@NamedQuery(name = "Consistsof.findAll", query = "SELECT c FROM Consistsof c"), @NamedQuery(name = "Consistsof.findByFlight", query = "SELECT c FROM Consistsof c WHERE c.consistsofPK.flight = :flight"), @NamedQuery(name = "Consistsof.findByArrDate", query = "SELECT c FROM Consistsof c WHERE c.consistsofPK.arrDate = :arrDate"), @NamedQuery(name = "Consistsof.findByDepDate", query = "SELECT c FROM Consistsof c WHERE c.consistsofPK.depDate = :depDate"), @NamedQuery(name = "Consistsof.findByTripNr", query = "SELECT c FROM Consistsof c WHERE c.consistsofPK.tripNr = :tripNr")})
public class Consistsof implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ConsistsofPK consistsofPK;

    public Consistsof() {
    }

    public Consistsof(ConsistsofPK consistsofPK) {
        this.consistsofPK = consistsofPK;
    }

    public Consistsof(String flight, Date arrDate, Date depDate, String tripNr) {
        this.consistsofPK = new ConsistsofPK(flight, arrDate, depDate, tripNr);
    }

    public ConsistsofPK getConsistsofPK() {
        return consistsofPK;
    }

    public void setConsistsofPK(ConsistsofPK consistsofPK) {
        this.consistsofPK = consistsofPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (consistsofPK != null ? consistsofPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Consistsof)) {
            return false;
        }
        Consistsof other = (Consistsof) object;
        if ((this.consistsofPK == null && other.consistsofPK != null) || (this.consistsofPK != null && !this.consistsofPK.equals(other.consistsofPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Consistsof[consistsofPK=" + consistsofPK + "]";
    }

}
